<extend name="Public:layout"/>
<block name="content">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> 友情链接列表</strong></div>
        <div class="container-fluid">
            <!--<div class="row padding">
                <form action="{:U('')}" method="post" class="form">
                    <div class="form-group">
                        <div class="col-lg-1 col-md-1">站点</div>
                        <div class="col-lg-3 col-md-3">
                            <select name="website_id" class="form-control">
                                <option value="">全部</option>
                                <foreach name="website" key="k" item="vo">
                                    <option value="{$k}" <?php if($k == $map['website_id']) echo "selected"?>>{$vo}</option>
                                </foreach>
                            </select>
                        </div>
                        <div class="col-lg-3 col-md-3">
                            <button type="submit" class="btn btn-primary icon-search"> 搜索</button>
                        </div>
                        <div class="col-lg-5 col-md-5"></div>
                    </div>

                    </ul>
                </form>
            </div>-->
            <div class="clearfix"></div>
            <div class="row padding">
                <a class="btn btn-primary icon-plus" href="{:U('edit')}"> 添加友情链接</a>
                <!--<a type="button" href="javascript:void(0)" class="btn btn-primary icon-sort sort-list" data-url="{:U('sort')}">排序</a>-->
            </div>
        </div>

        <table class="table table-hover text-center">
            <thead>
            <tr>
                <th width="100" style="text-align:left; padding-left:20px;">ID</th>
                <!--<th width="100">排序</th>-->
                <th>名称</th>
                <th>链接</th>
                <th>状态</th>
                <th width="310">操作</th>
            </tr>
            </thead>
            <tbody>
            <volist name="list" id="vo">
                <tr>
                    <td style="text-align:left; padding-left:20px;">{$vo.link_id}</td>
                    <!--<td><input type="text" class="form-control" name="sort[]" value="{$vo.sort}"></td>-->
                    <td>{$vo.link_name}</td>
                    <td>{$vo.link_url}</td>
                    <td>{$vo['status'] ? '<div class="btn btn-info">正常</div>':'<div class="btn btn-danger">禁用</div>'}</td>
                    <td>
                        <div class="btn-group">
                            <a class="btn btn-primary" href="{:U('edit', 'link_id='.$vo['link_id'])}"><span class="icon-edit"></span> 修改</a>
                            <a class="btn btn-info ajax-click" href="javascript:void(0)" data-url="{:U('ban', 'link_id='.$vo['link_id'].'&status='.!$vo['status'])}"><span class="icon-edit"></span> {$vo['status'] ? '禁用' : '启用'}</a>
                            <a class="btn btn-danger ajax-click" href="javascript:void(0)" data-url="{:U('del', 'link_id='.$vo['link_id'])}"><span class="icon-trash-o"></span> 删除</a>
                        </div>
                    </td>
                </tr>
            </volist>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="8"><div class="pagelist"> {$page} </div></td>
            </tr>
            </tfoot>
        </table>
    </div>
</block>